<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page errorPage="/dorado/exception.d" %>
<%@ taglib uri="http://www.bstek.com/dorado" prefix="d" %>
<%@page import="java.util.*"%>
<%@page import="com.xr.common.Tools"%>
<html>
<head>
<title>上传共享文件</title>
</head>
<body>
<script language="javascript">
 function doSub(){
    form1.oldfilename.value=form1.file.value;
    form1.submit();
 }
</script>
  <d:View config="com.xr.oa.fileShare.uploadFile">
    <%
    String key=Tools.toStr(request.getParameter("FILES_ID"));
    String table=Tools.toStr(request.getParameter("table"));
    String column=Tools.toStr(request.getParameter("column"));
    String keyvalue=Tools.toStr(request.getParameter(key));
    String toDB=Tools.toStr(request.getParameter("toDB"));  
    String writeback=Tools.toStr(request.getParameter("writeback"));   
    String catalog=Tools.toStr(request.getParameter("catalog")); 
    String writebackFullNewName=Tools.toStr(request.getParameter("writebackFullNewName"));
%>
<center>    
      <form method="post" name="form1" enctype="multipart/form-data"
        action="<%=request.getContextPath()%>/oa/fileShare.upload.d">       
<%      
String oldFileName = (String)request.getAttribute("old_name") ;
String upload_result = (String)request.getAttribute("upload_result");
if (upload_result != null) { 
%>
    <input type="hidden" name="oldfilename" value="<%=oldFileName%>">
    <script language="javascript">     
      <%
      String back=(String)request.getAttribute("write_back"); 
      if(back.equals("1")){
      %>        
         //parent.writeBackFileName(document.form1.oldfilename.value);
    <%
      }
      String backFullNewName=(String)request.getAttribute("write_back_full_new_name");       
      if(Tools.toStr(backFullNewName).equals("1")){
         String fullNewName=(String)request.getAttribute("full_new_name");
         System.out.println("YYYYYYYYYYYYY"+fullNewName);
     %>
        //parent.writeBackFullNewName('<%=fullNewName%>');
    <%
      }
    %>
      //try{    
      parent.datasetFileSub.flushData();    
         SubWindow.hideParent();
     // }catch (theException) {
       //   alert("ddd");
     // } finally {
 
         alert(" 文件上传成功 ！");
     // }
    </script>  
<%
}
else {
%>     
        <input type="hidden" name="key" value="<%=key%>">  
        <input type="hidden" name="table" value="<%=table%>">  
        <input type="hidden" name="column" value="<%=column%>">  
        <input type="hidden" name="keyvalue" value="<%=keyvalue%>">  
        <input type="hidden" name="toDB" value="<%=toDB%>"> 
        <input type="hidden" name="writeback" value="<%=writeback%>"> 
        <input type="hidden" name="oldfilename" value="">   
        <input type="hidden" name="catalog" value="<%=catalog%>">
        <input type="hidden" name="writebackFullNewName" value="<%=writebackFullNewName%>">
        
        <d:Layout type="vflow" width="90%">
           
          <d:Pane valign="middle" height="30">
            请选择要上传的文件:
            <input class="TextEditor" type="file" name="file" style="width: 100%">
          </d:Pane>
          <d:Pane align="center">
            <input class="Button" type="button" value=" 上传 " onclick="doSub()">
          </d:Pane>
        </d:Layout>
     
<%
}
%>    
 </form>
</center> 
  
  </d:View>
</body>
</html>
